Repository navigation
Add Brazilian Portuguese familiar forms from Brazil's ballot names (#1495) - #1511
Merged
Merged
Conversation
… names (#1495) tools/vocab/familiar_tse.py fetches every election's candidate file from the Superior Electoral Court's open-data portal (CC BY) and pairs each candidate's ballot name with the civil given name it stands for, counting people once across elections by a hashed key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot names (#1495) 1,505 pairs at 20 people or more, after a given-word filter, a byname filter and a lift rescue, read by two readers: 1,035 familiar forms ship in pt-BR.toml, the 122 agreed spellings are held. The court's CC BY is credited in pt-BR.toml and README.rst's License section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he court (#1495) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and the note (#1495) The given-word filter counts a second word only where another follows it, dropping three shipped surname diminutives; the kept per-year reading is named by its zip's digest and the reader's version and checked whole; a member cut inside its last field, a renamed ID column, a blank candidate number or a year of no names is refused; drops are counted by reason. The note on every generated reading says openly licensed, not CC0, the court's data being CC BY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est the fix's checks (#1495) given_words took the last name word as the family name, so a surname with an apostrophe or a hyphen made a real second given name the family; it now reads the last word that is no particle. Tests hold a person's second pair of names, a republished zip read again, a member of no candidate and the drop counts. The entry's figures are re-taken on this tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1495) JOÃO VIEIRA DO O read Vieira as a given word, the stray O taken as the family; a single letter or a stop word ends no name now. Three more surname diminutives leave the draw and the review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep both release-log bullets; regenerate nameparser/config/_index.py with tools/vocab/build.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1495.
Adds
tools/vocab/familiar_tse.py, a generator of Brazilian Portuguese familiar-form candidates from the names Brazil's election candidates register for the ballot beside their civil names. It also ships the 1,030 familiar forms two readers agreed on, inpt-BR.toml. The 118 agreed alternate spellings are held and ship nowhere, as #1387's were.The source and its licence
The source is the Superior Electoral Court's candidate files,
consulta_cand_<year>.zip, for all 16 elections from 1994 to 2024.Licence, confirmed 2026-11-20 from the court's own portal:
package_show?id=candidatos-<year>giveslicense_idcc-byon every one of the 16 datasets, chosen from a licence list that also offers CC0, CC BY-SA and a non-commercial licence.Where it is credited: README.rst's License section,
nameparser/vocab/pt-BR.toml, andtests/v2/test_licensing.py's_CREDITED._CREDITEDis now keyed by source, because the INE and the court are both CC BY. The data is measured, so the licence expression is unchanged.What is kept where:
The generator
The pair:
júnior,juninho,filho,neto,sobrinho, epithets) and not in the civil name.Answers to the issue's three questions (decided 2026-11-20):
pt-BRalone. Nothing in the data contradicts it.match_diff.py --base, after this change's own rows, plus the candidates' own names as the population measure.The bar, raised from the issue's 10 to 20. The trial read 2024 alone. Sixteen elections multiplied the pairs to 7,899 at ten, eight times the trial's 990.
Two filters and a rescue, at 20+:
castr/castro), a surname's diminutive (castrinho/castro), or an occupation matched to a surname by its letters (enfermeira/pereira)irmão,dona,tia,saúde,sargento,enfermeira,pastora); 265 of their pairs are rescuedThe rescue: a byname's pair is kept where its lift is ≥ 5 and it has ≥ 50 people. Lift is the share of the ballot word's people whose civil word is this one, over that word's share of everyone.
zé/josé9.7,beto/roberto13.7,chico/francisco27.0,leo/leonardo228.6.irmão/josé1.2,tia/maria2.4,dona/maria3.7.zé/josé. The bar lets 5 bynames through to the readers.The review
Procedure:
Rows read: the first build drew 1,505. Review then found a surname defect (below). The fixed tool no longer draws 15 of those rows, which leave the table, and draws one new pair,
fernado/fernando, which two readers read as a spelling; it is held. That leaves 1,491.Agreement: 1,369 of 1,491 (91.8%).
False pairs, by class (agreed different-names where both readers gave one class): epithet 50, another given name 28, occupation 24, surname 13, address 10, religious 4. No further filter was needed.
Measurements
FAMILIARgoes from 1,286 to 2,316 pairs;ALTERNATE_SPELLINGSis unchanged at 294.tools/differential/snapshot.jsonlis byte-identical.tools/differential/match_diff.py --baseagainst 3ca31c2, after Brazilian test rows in every shape the match reads:Tiaoagainst the storedtião.familiar-form, and none goes the other way.familiar-form, consistent pairs go from 24,162 to 25,972 (+1,810, +1.0 point).Docs
Paulinho/Paulo,Cida/Aparecida) #1495 entry with the recipe, the comparator (the review table before this change, and master 3ca31c2), the filters and what each drops, the rescue with both sides of each threshold, the false-pair classes, and the measurements.Paulinho/Paulo,Cida/Aparecida) #1495 entry.docs/matching.rst,nameparser/vocab/README.md,AGENTS.md, README.rst's License section, and the release log.Reviews
Round 1: pr-review-toolkit code-reviewer, pr-test-analyzer, silent-failure-hunter and comment-analyzer, plus design-docs-reviewer. Fixed in b1630f3:
costinha/costa,teixeirinha/teixeira,borginho/borges).pt-BRclaim are corrected.Round 2, on the fix commit (code-reviewer, design-docs-reviewer). Fixed in e92286e and 5c57455:
D'ÁVILA) as missing, which made a real second given name the family.Round 3, on e92286e (code-reviewer). A stray single letter or a generation after the surname (
DO O,JUNIOR) counted as the family name, which made the surname a given word. Fixed in e011f33: such a word ends no name. Three more surname diminutives leave the draw, and the figures were re-taken.Flagged, not changed:
santinho/santosships. It is reached through civil names where Santos stands second of three words, and both readers agree it is a familiar form.🤖 Generated with Claude Code